SpatialStream® Code Examples

Simple Spatial Query (Point to Polygon Layer)

A simple Spatial Query can be a valuable tool when an application needs to pull data from one dataset based on its spatial relationship to a geometry. This example performs a simple Spatial Query on the Neighborhoods layer, using the mouse click location as the spatial criteria. The mouse click event is captured and the query is executed. The query returns the Neighborhoods that overlap the mouse click location.

While our general recommended approach for this workflow is to use Spatial Chaining, there are times when constructing a simple Spatial Query is useful. For instance, a simple Spatial Query can be used to incorporate a basic identify function, return, on-the-fly, related data from intersecting geometries, or occasionally, where the setup of a Spatial Relationship rule does not make sense.

var url = "GetByGeometry.aspx?";
url += "dataSource=ACCOUNT_FOLDER/Neighborhoods";
url += "&geo=POINT(" + LL.lng() + " " + LL.lat() + ")"


Run Sample   View Video   Back To Index